package com.sosee.cgfw.activity;

import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;

import com.sosee.cgfw.R;
import com.sosee.cgfw.utils.Constans;
import com.umeng.analytics.MobclickAgent;
import com.wujay.fund.GestureEditActivity;
import com.wujay.fund.GestureVerifyActivity;

/**
 * Created by Thinkpad on 2016/3/8.
 * 创建手势密码界面
 */
public class SafeCreateActivity extends Activity {


    @Override
    protected void onResume() {
        super.onResume();
        MobclickAgent.onResume(this);
    }

    @Override
    protected void onPause() {
        super.onPause();
        MobclickAgent.onPause(this);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_safe_create);
    }

    public void click(View view){
        int id=view.getId();
        switch (id){
            case R.id.ll_create:
                test();
                break;
            case R.id.ll_update:
                test();
                break;
            case R.id.ll_cancle:
                break;
            case R.id.fanhui:
                finish();
                break;
        }
    }
    public void test(){
         SharedPreferences sp=getSharedPreferences(Constans.GESTURENAME,MODE_PRIVATE);
        String mGesture=sp.getString(Constans.GESTURE,null);
        if(mGesture!=null&&mGesture.length()>3){
            Intent intent=new Intent(this, GestureVerifyActivity.class);
            intent.putExtra("flag","1");//标记隐私页面跳转
            startActivity(intent);
        }else{
            startActivity(new Intent(this,GestureEditActivity.class));
        }
    }




}
